package com.emip.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.emip.bean.ItemBean;
import com.emip.bean.RealDataBean;
import com.emip.bean.SiteBean;
import com.emip.dao.BaseDAO;
import com.emip.dao.RealDataDAO;

@Repository("realDataDAO")
public class RealDataDAOImpl extends BaseDAO implements RealDataDAO {

	public RealDataBean findBySiteItem(SiteBean site, ItemBean item) {
		Object[] params = new Object[] {site, item};
		List<RealDataBean> results = (List<RealDataBean>)this.getHibernateTemplate().find("from RealDataBean m where site=? and item=?", params);
		if (results.size()==0) {
			return null;
		} else {
			return results.get(0);
		}
	}

}
